package com.hutianao.gqgl.user.repository;

import com.hutianao.gqgl.mybatis.entity.PtMenuEntity;
import com.hutianao.gqgl.mybatis.entity.PtRoleEntity;
import com.hutianao.gqgl.mybatis.entity.PtUserEntity;
import com.hutianao.gqgl.mybatis.ztree.ZtreeEntity;
import com.hutianao.gqgl.user.entity.SearchUserEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PaddingEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface UserDao {
    List<PtUserEntity> queryUserInfoListByName(@Param("search") SearchUserEntity search);

    void deleteUserInfoByIds(@Param("id")String id);

    PtUserEntity queryUserInfoByName(@Param("userName") String userName);

    List<PtMenuEntity> queryMenuListByLang(@Param("lang") String lang);

    void modifyUserInfoById(@Param("entity") PtUserEntity ptUserEntity);

    List<String> queryrivilegeList(@Param("userUuid")String userUuid);

    List<PtUserEntity> queryUserInfoListByPage(@Param("entity")SearchUserEntity entity,@Param("padding")PaddingEntity paddingEntity);

    Integer queryUserInfoTotal(@Param("entity")SearchUserEntity entity);

    List<ZtreeEntity> queryRoleTreeList();

    void delRoleByUserId(@Param("userUuid") String userUuid);

    void insertRoleRefUser(@Param("userUuid")String userUuid, @Param("roleUuid")String roleUuid);

    List<String> queryRoleByUserUuuid(@Param("userUuid")String userUuid);

    List<PtMenuEntity> queryMenuLevelListByUserUuid(@Param("userUuid")String userUuid,@Param("lang") String lang);

    void insertUserInfo(@Param("entity") PtUserEntity ptUserEntity);

    void modifyUserInfo(@Param("entity") PtUserEntity ptUserEntity);

    void deleteUserById(@Param("userUuids") String[] userUuids);

    List<ZtreeEntity> queryDepTree();

//    void deleteDepByUserId(@Param("userUuid") String userUuid);

    void insertUserRefDep(@Param("userUuid") String userUuid,@Param("depIds") String depIds);

    List<String> queryDepByUserId(@Param("userUuid") String userUuid);

    List<PtUserEntity> queryUserInfoByMail(String email);


    void updateStatusByAccount(@Param("userName") String account, @Param("time") Date time, @Param("isSum") int isSum);
    PtUserEntity selectUserByAccountAndTime(@Param("userName") String account);

    void updateTimeByAccount(@Param("userName") String account, @Param("time") Date date);

    void unlockUserById(@Param("id") String id,@Param("time") Date time);

    PtUserEntity queryIsSumUserInfoByName(@Param("userName") String username,@Param("time") Date time);

    void updatePasswordByUserName(@Param("username") String username,@Param("password") String password);


}